<html>
<head>Add residence</head>

 
<body>
<?php
$res=$_POST['res'];
if(!empty($_POST['res']))
	{
	echo "Greetings,{$_POST['res']},you are here";}

$db = mysql_connect("localhost", "root");
mysql_select_db("connection",$db);
$result = mysql_query("insert into resid values('$res')",$db);


 ?>
<form action ="<?php $PHP_SELF;?>" method="post">
Enter RES name:<input type="text" name="res"/>
<input type="submit"/>
</form>

</body>
</html>
